package zhang;/**
 * Created by mac on 2018/8/14.
 */

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;

/**
 * @ClassName dateUtils
 * @Description
 * @Author zhang
 * @Date 2018/8/14 14:15
 */
public class dateUtils {

    public static void main(String[] args) {

        LocalDate localDate = LocalDate.now();
        System.out.println(localDate);
        localDate = localDate.minusDays(-1);
        String local = localDate.toString();
        System.out.println(localDate);


        Date date = new Date();
//        Calendar calendar = new GregorianCalendar();
//        calendar.setTime(date);
//        calendar.add(Calendar.DATE, 1);
//        date = calendar.getTime();
//        System.out.println(date);

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd");
        String format = sdf.format(date);
        try {
            Date startTime = sdf.parse(format);
            Date endTime = sdf1.parse(local);

            System.out.println(startTime  +"==========="+endTime);

            long startTimeTime = startTime.getTime();
            long endTimeTime = endTime.getTime();

            System.out.println(startTimeTime);
            System.out.println(endTimeTime);

            long l = endTimeTime - startTimeTime;
            System.out.println(l);

            long miao = l / 1000;
            System.out.println("秒：=======" + miao);
            long fen = miao % 60 == 0 ? miao / 60 : (miao / 60) - 1;
            System.out.println("分：=======" + fen);



        }catch (Exception e){
            System.out.println(e);
        }

        test();

    }


    public static void test(){
        for (int i = 0 ; i < 10 ; i ++){
            if (i == 1 || i == 3 || i == 5 || i == 7|| i == 9){
                continue;
            }
            for (int j = 0 ; j < 10 ; j ++){
                System.out.println("j========" + j);
                if (j == i){
                    System.out.println(j + "=======" + i);
                }else {
                    continue;
                }
            }

        }
    }



}
